package com.zzyweb.managementsystem.controller;

import com.zzyweb.managementsystem.pojo.Menu;
import com.zzyweb.managementsystem.service.MenuService;
import com.zzyweb.managementsystem.util.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhiyi
 * @date 9/23/25
 **/
@RestController
@RequestMapping("/menu")
@CrossOrigin
public class MenuController {
    @Autowired
    private MenuService menuService;
    @GetMapping("/list")
    public ResponseObject getMenusByUsername(@RequestParam String username) {
        List<Menu> menuList = menuService.getMenuByUsername(username);
        return ResponseObject.ok(menuList);
    }
}
